package Object;

import Task.DSTask;

//@author A0103535R
/************************************ Abstract Class DSHistory ***************************/
public class DSHistory {
	public static final int DSHISTORY_ADD_TASK = 1;
	public static final int DSHISTORY_DELETE_TASK = 2;
	public static final int DSHISTORY_UPDATE_TASK = 3;
	public static final int DSHISTORY_QUERY = 4;
	
	private int _historyType;
	private DSQuery _historyQuery = null;
	private DSTask _historyTask = null;
    
	/**
	 * This is the constructor of task related DSHistory
	 */
	public DSHistory(int type, DSTask task){
		this._historyType = type;
		this._historyTask = task;
		this._historyQuery = null;
	}
    
	/**
	 * This is the constructor of query related DSHistory
	 */
	public DSHistory(int type, DSQuery query){
		this._historyType = type;
		this._historyQuery = query;
		this._historyTask = null;
	}
    
	/**
	 * This function is used to get the type of history
	 * 
	 * @return the type of history
	 */
	public int getType(){
		return this._historyType;
	}
    
	/**
	 * This function is used to get the query recorded in history
	 * 
	 * @return the query recorded in history
	 */
	public DSQuery getQuery(){
		return this._historyQuery;
	}
    
	/**
	 * This function is used to get the task recorded in history
	 * 
	 * @return the task recorded in history
	 */
	public DSTask getTask(){
		return this._historyTask;
	}
}
